package D2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2024-05-16
 * Time: 11:40
 */
public class Circle {
    private double radius = 1;//默认值
    public Circle(){
    }
    public Circle(double radius){
        setRadius(radius);
    }
    public double getRadius(){
        return radius;
    }
    public double getArea(){
        return 3.14*radius*radius;
    }

    public void setRadius(double radius){
        if(radius>0)
            this.radius = radius;
    }
}
